{% extends "base.html" %}

{% load staticfiles %}

{% block content %}

<script src="{% static "jquery.js" %}"></script>
<script>
  $( document ).ready(function() { 
//     $('input').css('visibility', 'hidden')
    $('input').change(function(event){
      var date, dispo, panier;
      date = $(this).attr("date");
      dispo = $("#dispo_"+date).is(':checked');
      panier = $("#panier_"+date).is(':checked');
      $.post('/participant/change/', 
      {
	date:date,
	dispo:dispo,
	panier:panier
      },
      function(data){
	console.log('return from change');
      });
    });
  });  
</script>
{% for u in p%}
Nom     : {{u.user.last_name}}<br>
Prenom  : {{u.user.first_name}}<br>
Email   : {{u.user.email}}<br>
{% endfor %}
<br>
Groupes : {{ groupes|join:", " }}<br>
Paniers : {{ types|join:", " }}<br>

<p>
    
{% for tbl in tblx %}
<table border='1'>
    <tr>
        <td>Date</td>
    {% for d in tbl.dates %}
        <td>{{ d|safe }}</td>
    {% endfor %}
    </tr><tr>
        <td>Dispo</td>
    {% for d in tbl.dispo %}
        <td>{{ d|safe }}</td>
    {% endfor %}
    </tr><tr>
        <td>Panier</td>
    {% for p in tbl.panier %}
        <td>{{ p|safe }}</td>
    {% endfor %}
    </tr>
</table><br>
{% endfor %}
</p>

{% endblock %}
